package net.zigin.nhi.could.waste.model;

import java.util.Date;

import lombok.Data;
import net.zigin.commons.util.StringUtil;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-13 21:14:44                                               
##################################################################*/

/**
 * WasteRecord实体类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: WasteRecord
 * @date 2021-9-13 21:14:44
 */
@Data
public class WasteBaseRecord {
    //医废记录ID--->列名: id
    private String id;
    //操作前员工ID--->列名: before_user_staff_id
    private String beforeUserStaffId;
    //操作后员工ID--->列名: after_user_staff_id
    private String afterUserStaffId;
    //医废基础ID--->列名: waste_base_id
    private String wasteBaseId;
    //记录类型（do_collect：收集，in_depot：入库，out_depot：出库）--->列名: type
    private String type;
    //记录内容--->列名: content
    private String content;
    //记录时间--->列名: time
    private Date time;
    //医废重量--->列名: weight
    private float weight;

    public WasteBaseRecord() {
    }

    public WasteBaseRecord(WasteBase wasteBase, String staffId) {
        this.id = StringUtil.get32UUID();
        this.wasteBaseId = wasteBase.getId();
        this.type = wasteBase.getStatus();
        this.weight = wasteBase.getWeight();
        this.time = new Date();
        if (wasteBase.getStatus().equals("do_collect")) {
            this.beforeUserStaffId = wasteBase.getHandUserStaffId();
            this.afterUserStaffId = wasteBase.getCollectUserStaffId();
        } else if (wasteBase.getStatus().equals("in_depot")) {
            this.beforeUserStaffId = wasteBase.getCollectUserStaffId();
            this.afterUserStaffId = staffId;
        } else if (wasteBase.getStatus().equals("out_depot")) {
            this.beforeUserStaffId = staffId;
            this.afterUserStaffId = wasteBase.getUserRevicerId();
        }
    }
}
